package com.ruoyi.merchant.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.merchant.mapper.MerchantCouponIssueMapper;
import com.ruoyi.merchant.domain.MerchantCouponIssue;
import com.ruoyi.merchant.service.IMerchantCouponIssueService;

/**
 * 优惠券发放记录Service业务层处理
 * 
 * @author dongdong
 * @date 2025-10-30
 */
@Service
public class MerchantCouponIssueServiceImpl implements IMerchantCouponIssueService 
{
    @Autowired
    private MerchantCouponIssueMapper merchantCouponIssueMapper;

    /**
     * 查询优惠券发放记录
     * 
     * @param id 优惠券发放记录主键
     * @return 优惠券发放记录
     */
    @Override
    public MerchantCouponIssue selectMerchantCouponIssueById(Long id)
    {
        return merchantCouponIssueMapper.selectMerchantCouponIssueById(id);
    }

    /**
     * 查询优惠券发放记录列表
     * 
     * @param merchantCouponIssue 优惠券发放记录
     * @return 优惠券发放记录
     */
    @Override
    public List<MerchantCouponIssue> selectMerchantCouponIssueList(MerchantCouponIssue merchantCouponIssue)
    {
        return merchantCouponIssueMapper.selectMerchantCouponIssueList(merchantCouponIssue);
    }

    /**
     * 新增优惠券发放记录
     * 
     * @param merchantCouponIssue 优惠券发放记录
     * @return 结果
     */
    @Override
    public int insertMerchantCouponIssue(MerchantCouponIssue merchantCouponIssue)
    {
        merchantCouponIssue.setCreateTime(DateUtils.getNowDate());
        return merchantCouponIssueMapper.insertMerchantCouponIssue(merchantCouponIssue);
    }

    /**
     * 修改优惠券发放记录
     * 
     * @param merchantCouponIssue 优惠券发放记录
     * @return 结果
     */
    @Override
    public int updateMerchantCouponIssue(MerchantCouponIssue merchantCouponIssue)
    {
        merchantCouponIssue.setUpdateTime(DateUtils.getNowDate());
        return merchantCouponIssueMapper.updateMerchantCouponIssue(merchantCouponIssue);
    }

    /**
     * 批量删除优惠券发放记录
     * 
     * @param ids 需要删除的优惠券发放记录主键
     * @return 结果
     */
    @Override
    public int deleteMerchantCouponIssueByIds(Long[] ids)
    {
        return merchantCouponIssueMapper.deleteMerchantCouponIssueByIds(ids);
    }

    /**
     * 删除优惠券发放记录信息
     * 
     * @param id 优惠券发放记录主键
     * @return 结果
     */
    @Override
    public int deleteMerchantCouponIssueById(Long id)
    {
        return merchantCouponIssueMapper.deleteMerchantCouponIssueById(id);
    }
}
